import Vue from 'vue';
import VueRouter from 'vue-router';
import Home from '../views/Home.vue';
// import { getToken } from '@/utils/auth';
// import { Message } from 'element-ui';
Vue.use(VueRouter);

export const routes = [
    {
        path: '/',
        name: 'Home',
        component: Home,
    },
    // {
    //     path: '/Login',
    //     name: 'Login',
    //     component: () => import('@/views/login.vue'),
    // },
    {
        path: '/Modern',
        name: 'Modern',
        component: () => import('@/views/ModernDrama.vue'),
    },

    {
        path: '/WebPlayer',
        name: 'WebPlayer',
        component: () => import('@/views/WebPlayer.vue'),
    },

    {
        path: '/Order',
        name: 'Order',
        component: () => import('@/views/OrderList.vue'),
    },
    
    {
        path: '*',
        redirect:'/'
    },
];

const router = new VueRouter({
    routes,
});

// router.beforeEach((to, from, next) => {
//     if (to.path === '/login') {
//         next();
//     } else {
//         if (getToken()) {
//             next();
//         } else {
//             next('/login');
//         }
//     }
// });

export default router;
